﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_SaleOrder : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvKhachHang")]
        private ADVObjects _AdvKhachHang;
        [AccessedThroughProperty("AdvNhanVien")]
        private ADVObjects _AdvNhanVien;
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTab2")]
        private C1DockingTab _C1DockingTab2;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("CboLienHe")]
        private ComboBox _CboLienHe;
        [AccessedThroughProperty("CboLoaiGia")]
        private ComboBox _CboLoaiGia;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CboPhuongThucThanhToan")]
        private ComboBox _CboPhuongThucThanhToan;
        [AccessedThroughProperty("CboPhuongThucVanChuyen")]
        private ComboBox _CboPhuongThucVanChuyen;
        [AccessedThroughProperty("CboTinhTrang")]
        private ComboBox _CboTinhTrang;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdInTiengAnh")]
        private ToolStripMenuItem _CmdInTiengAnh;
        [AccessedThroughProperty("CmdInTiengViet")]
        private ToolStripMenuItem _CmdInTiengViet;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripSplitButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("cmdTimDonHang")]
        private Button _cmdTimDonHang;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("CmdXacNhan")]
        private ToolStripButton _CmdXacNhan;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label14")]
        private Label _Label14;
        [AccessedThroughProperty("Label15")]
        private Label _Label15;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label17")]
        private Label _Label17;
        [AccessedThroughProperty("Label18")]
        private Label _Label18;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label20")]
        private Label _Label20;
        [AccessedThroughProperty("Label21")]
        private Label _Label21;
        [AccessedThroughProperty("Label22")]
        private Label _Label22;
        [AccessedThroughProperty("Label23")]
        private Label _Label23;
        [AccessedThroughProperty("Label24")]
        private Label _Label24;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("mnInPhanTinhLoiNhuan")]
        private ToolStripMenuItem _mnInPhanTinhLoiNhuan;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtCongThemNT")]
        private C1NumericEdit _TxtCongThemNT;
        [AccessedThroughProperty("TxtDiaChiGiaoHang")]
        private TextBox _TxtDiaChiGiaoHang;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtHanGiaoHang")]
        private DateTimePicker _TxtHanGiaoHang;
        [AccessedThroughProperty("TxtHoaHong")]
        private C1NumericEdit _TxtHoaHong;
        [AccessedThroughProperty("TxtMuaHang")]
        private C1NumericEdit _TxtMuaHang;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayDathang")]
        private DateTimePicker _TxtNgayDathang;
        [AccessedThroughProperty("TxtNgayThanhToan")]
        private DateTimePicker _TxtNgayThanhToan;
        [AccessedThroughProperty("TxtSoBaoGia")]
        private TextBox _TxtSoBaoGia;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoHopDong")]
        private TextBox _TxtSoHopDong;
        [AccessedThroughProperty("TxtSoLuong")]
        private C1NumericEdit _TxtSoLuong;
        [AccessedThroughProperty("TxtSoTienNT")]
        private C1NumericEdit _TxtSoTienNT;
        [AccessedThroughProperty("TxtTienThueNT")]
        private C1NumericEdit _TxtTienThueNT;
        [AccessedThroughProperty("TxtTongCongNT")]
        private C1NumericEdit _TxtTongCongNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private string cFrmFormat;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmLanguage;
        private const string cFrmLoai = "SO";
        private string cFrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsDonDatHang objDH;
        private clsDonDatHangChiTiet objDHCT;
        private clsDMLoaiTien ObjLT;
        private clsSoChungTu objSoCT;

        public Frm_SaleOrder()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_DonDatHangBan_KeyDown);
            base.Load += new EventHandler(this.Frm_DonDatHangBan_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "DHKH";
            this.objSoCT = new clsSoChungTu();
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.cFrmTask = "";
            this.objDH = new clsDonDatHang();
            this.objDHCT = new clsDonDatHangChiTiet();
            this.ObjLT = new clsDMLoaiTien();
            this.InitializeComponent();
        }

        private void AdvNhaCungCap_ValueChanged(object sender, EventArgs e)
        {
            if (this.AdvKhachHang.Value.Trim() == "")
            {
                this.CboLienHe.Text = "";
                this.CboLienHe.SelectedValue = "";
                this.CboLienHe.DataSource = null;
            }
            else
            {
                clsDMDoiTuong tuong = new clsDMDoiTuong();
                tuong.Load(this.AdvKhachHang.Value);
                this.CboLienHe.DataSource = tuong.GetContactor(tuong.Khoa);
                this.CboLienHe.ValueMember = "Khoa";
                this.CboLienHe.DisplayMember = "Ten";
                if (this.CboLienHe.Items.Count >= 1)
                {
                    this.CboLienHe.SelectedIndex = 0;
                }
                this.TxtDiaChiGiaoHang.Text = tuong.DiaChiGiaoHang.Trim();
                if (tuong.KhoaLoaiGia.Trim() != "")
                {
                    this.CboLoaiGia.SelectedValue = tuong.KhoaLoaiGia;
                }
                else
                {
                    this.CboLoaiGia.SelectedValue = modGeneral.H_GIACHUAN;
                }
                this.AdvNhanVien.Value = tuong.KhoaNhanVienQuanLy;
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
                if (strCode != "")
                {
                    this.ObjLT.LoadByCode(strCode);
                    if (this.ObjLT.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("000000000", this.ObjLT.SoLe);
                    }
                    if (this.ObjLT.TienViet == 1)
                    {
                        this.txtTyGia.Enabled = false;
                    }
                    else
                    {
                        this.txtTyGia.Enabled = true;
                    }
                    this.txtTyGia.Value = this.ObjLT.TyGia;
                    this.FormatNumber();
                }
            }
        }

        public bool CheckIvalid()
        {
            if (this.TxtSoChungTu.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objDH.IsDuplicateVoucherNo(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa, "SO"))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ bị tr\x00f9ng!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.AdvKhachHang.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập nh\x00e0 cung cấp!", ""));
                this.AdvKhachHang.Focus();
                return false;
            }
            if (this.CboTinhTrang.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn t\x00ecnh trạng đơn đặt h\x00e0ng!", ""));
                this.CboTinhTrang.Focus();
                return false;
            }
            if (Microsoft.VisualBasic.CompilerServices.Operators.CompareString(LVYModule.Date2Char(this.TxtHanGiaoHang.Text), LVYModule.Date2Char(this.TxtNgayChungTu.Text), false) < 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Ng\x00e0y giao h\x00e0ng phải sau ng\x00e0y đặt h\x00e0ng!", ""));
                this.TxtHanGiaoHang.Focus();
                return false;
            }
            if (this.VSlist.Rows.Count == 1)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập h\x00e0ng h\x00f3a đặt mua!", ""));
                this.CmdAddRow.Focus();
                return false;
            }
            if (this.objDH.TrungSoChungTu(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn phải nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            return true;
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("BH_DonDatHangBan", 15, "SO");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
            this.cFrmTask = "I";
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (this.AdvKhachHang.Value.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập kh\x00e1ch h\x00e0ng!", ""));
                this.AdvKhachHang.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập loại tiền!", ""));
                this.CboLoaiTien.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiGia.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập loại gi\x00e1!", ""));
                this.CboLoaiGia.Focus();
            }
            else if ((this.VSlist.Rows.Count <= 1) || (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[this.VSlist.Rows.Count - 1, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != ""))
            {
                this.VSlist.AddItem("");
                this.VSlist.Select(this.VSlist.Rows.Count - 1, 2);
                this.VSlist.Focus();
            }
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (this.objDH.TinhTrang.Trim() != "OP")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Đơn h\x00e0ng đ\x00e3 được xử l\x00fd n\x00ean bạn kh\x00f4ng thể x\x00f3a!", ""));
            }
            else if (LVYModule.ConfirmDelete("") && this.objDH.DeleteData(this.cFrmKhoa))
            {
                this.EmptyData();
            }
        }

        private void CmdDelRow_Click(object sender, EventArgs e)
        {
            if ((this.VSlist.Rows.Count != 1) && (this.VSlist.Row > 0))
            {
                this.VSlist.RemoveItem(this.VSlist.Row);
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.EnabledControl = true;
                this.cFrmKhoaOld = this.cFrmKhoa;
                this.cFrmTask = "U";
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_DonDatHangBanList.Show();
        }

        private void CmdInTiengAnh_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintDatHang(this.cFrmKhoa, "ANH");
            }
        }

        private void CmdInTiengViet_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintDatHang(this.cFrmKhoa, "VIET");
            }
        }

        private void CmdPrint_ButtonClick(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintDatHang(this.cFrmKhoa, "VIET");
            }
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveTemp())
                {
                    this.objDH.ClearTemp(this.cFrmKhoa);
                }
                else if (!this.UpdateData())
                {
                    this.objDH.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objDH.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                    this.cFrmTask = "";
                }
            }
        }

        private void cmdTimDonHang_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_BaoGiaList.Dispose();
            MyProject.Forms.Frm_BaoGiaList.objFrmCall = this;
            MyProject.Forms.Frm_BaoGiaList.strConditions = " ( BG.TinhTrang = 0 or BG.TinhTrang = 1 ) And Rtrim(IsNull(BG.KhoaDonDatHang,'')) = '' ";
            MyProject.Forms.Frm_BaoGiaList.ShowDialog();
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoaOld, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
            }
            if (this.cFrmTask == "I")
            {
                this.objSoCT.UndoVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
            }
            this.cFrmTask = "";
            this.EnabledControl = false;
        }

        private void CmdXacNhan_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                MyProject.Forms.Frm_DuyetDonHangBan.cFrmKhoa = this.cFrmKhoa;
                MyProject.Forms.Frm_DuyetDonHangBan.ShowDialog();
                this.objDH.Load(this.cFrmKhoa);
                this.CboTinhTrang.SelectedValue = this.objDH.TinhTrang;
                this.TxtDienGiai.Text = this.objDH.DienGiai;
                this.TxtSoHopDong.Text = this.objDH.SoHopDong;
            }
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        public void EmptyData()
        {
            this.TxtSoChungTu.Text = "";
            this.AdvKhachHang.Value = "";
            this.TxtDiaChiGiaoHang.Text = "";
            this.CboLienHe.Text = "";
            this.AdvNhanVien.Value = "";
            this.TxtDiaChiGiaoHang.Text = "";
            this.TxtSoHopDong.Text = "";
            this.CboPhuongThucVanChuyen.SelectedValue = "";
            this.CboPhuongThucThanhToan.SelectedValue = "";
            this.TxtDienGiai.Text = "";
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 1;
            this.TxtSoTienNT.Value = 0;
            this.TxtTienThueNT.Value = 0;
            this.TxtCongThemNT.Value = 0;
            this.TxtTongCongNT.Value = 0;
            this.CboTinhTrang.SelectedIndex = 0;
            this.VSlist.Rows.Count = 2;
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtSoTienNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtCongThemNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTongCongNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienThueNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtMuaHang, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtHoaHong, this.cFrmFormat);
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Cols[8].Format = this.cFrmFormat;
            vSlist.Cols[9].Format = this.cFrmFormat;
            vSlist.Cols[12].Format = this.cFrmFormat;
            vSlist.Cols[13].Format = this.cFrmFormat;
            vSlist.Cols[15].Format = this.cFrmFormat;
            vSlist.Cols[0x11].Format = this.cFrmFormat;
            vSlist = null;
        }

        private void Frm_DonDatHangBan_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
                case Keys.Escape:
                    if (this.CmdExit.Enabled)
                    {
                        this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                    break;

                case Keys.F2:
                    if (this.CmdEdit.Enabled)
                    {
                        this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                    break;

                case Keys.F3:
                    this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    break;

                case Keys.F8:
                    if (this.CmdAdd.Enabled)
                    {
                        this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                    break;

                case Keys.F9:
                    if (this.CmdDel.Enabled)
                    {
                        this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                    break;

                case Keys.F10:
                    if (this.CmdSave.Enabled)
                    {
                        this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                    break;

                case Keys.F11:
                    if (this.CmdUnsave.Enabled)
                    {
                        this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                    break;
            }
        }

        private void Frm_DonDatHangBan_Load(object sender, EventArgs e)
        {
            BuildComboModule.BuildCombo(this.CboLoaiGia, modGeneral.ListDanhMuc.LoaiGiaBan, false, "", "");
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnabledControl = false;
                this.InitCombo();
                this.MergCell();
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    this.ShowData(this.cFrmKhoa);
                }
                this.VSlist.Cols[7].Editor = this.TxtSoLuong;
            }
        }

        private void Frm_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Return)
            {
                SendKeys.Send("{TAB}");
            }
        }

        public void InitCombo()
        {
            BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
            BuildComboModule.BuildCombo(this.CboPhuongThucThanhToan, modGeneral.ListDanhMuc.PhuongThucThanhToan, false, "", "");
            BuildComboModule.BuildCombo(this.CboPhuongThucVanChuyen, modGeneral.ListDanhMuc.PhuongThucVanChuyen, false, "", "");
            this.CboTinhTrang.Items.Clear();
            this.CboTinhTrang.DataSource = modGeneral.H_DUNGCHUNG.ShowList("0000000001");
            this.CboTinhTrang.ValueMember = "Ma";
            this.CboTinhTrang.DisplayMember = "Ten";
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_SaleOrder));
            this.cmdTimDonHang = new Button();
            this.Label20 = new Label();
            this.TxtNgayDathang = new DateTimePicker();
            this.Label21 = new Label();
            this.TxtSoBaoGia = new TextBox();
            this.CboLoaiGia = new ComboBox();
            this.Label3 = new Label();
            this.Label17 = new Label();
            this.Label18 = new Label();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.TxtSoHopDong = new TextBox();
            this.CboLienHe = new ComboBox();
            this.CboPhuongThucThanhToan = new ComboBox();
            this.Label7 = new Label();
            this.TxtHanGiaoHang = new DateTimePicker();
            this.Panel5 = new Panel();
            this.TxtHoaHong = new C1NumericEdit();
            this.Label23 = new Label();
            this.TxtMuaHang = new C1NumericEdit();
            this.Label22 = new Label();
            this.TxtTienThueNT = new C1NumericEdit();
            this.Label15 = new Label();
            this.TxtTongCongNT = new C1NumericEdit();
            this.Label14 = new Label();
            this.TxtCongThemNT = new C1NumericEdit();
            this.Label12 = new Label();
            this.TxtSoTienNT = new C1NumericEdit();
            this.Label5 = new Label();
            this.CmdAddRow = new Button();
            this.Label8 = new Label();
            this.CmdDelRow = new Button();
            this.Label19 = new Label();
            this.Panel4 = new Panel();
            this.TxtSoLuong = new C1NumericEdit();
            this.CboTinhTrang = new ComboBox();
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripSplitButton();
            this.CmdInTiengViet = new ToolStripMenuItem();
            this.CmdInTiengAnh = new ToolStripMenuItem();
            this.mnInPhanTinhLoiNhuan = new ToolStripMenuItem();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.CmdHelp = new ToolStripButton();
            this.CmdXacNhan = new ToolStripButton();
            this.TxtDiaChiGiaoHang = new TextBox();
            this.TxtNgayThanhToan = new DateTimePicker();
            this.AdvNhanVien = new ADVObjects();
            this.Label6 = new Label();
            this.CboPhuongThucVanChuyen = new ComboBox();
            this.Label4 = new Label();
            this.Label2 = new Label();
            this.Label16 = new Label();
            this.AdvKhachHang = new ADVObjects();
            this.TxtDienGiai = new TextBox();
            this.Label9 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.Label24 = new Label();
            this.C1DockingTab1 = new C1DockingTab();
            this.C1DockingTabPage1 = new C1DockingTabPage();
            this.C1DockingTab2 = new C1DockingTab();
            this.C1DockingTabPage2 = new C1DockingTabPage();
            this.VSlist.BeginInit();
            this.Panel5.SuspendLayout();
            ((ISupportInitialize) this.TxtHoaHong).BeginInit();
            ((ISupportInitialize) this.TxtMuaHang).BeginInit();
            ((ISupportInitialize) this.TxtTienThueNT).BeginInit();
            ((ISupportInitialize) this.TxtTongCongNT).BeginInit();
            ((ISupportInitialize) this.TxtCongThemNT).BeginInit();
            ((ISupportInitialize) this.TxtSoTienNT).BeginInit();
            this.Panel4.SuspendLayout();
            ((ISupportInitialize) this.TxtSoLuong).BeginInit();
            this.ToolStrip1.SuspendLayout();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            ((ISupportInitialize) this.C1DockingTab1).BeginInit();
            this.C1DockingTab1.SuspendLayout();
            this.C1DockingTabPage1.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab2).BeginInit();
            this.C1DockingTab2.SuspendLayout();
            this.C1DockingTabPage2.SuspendLayout();
            this.SuspendLayout();
            this.cmdTimDonHang.BackgroundImage = ACCOUNTING.My.Resources.Resources.view;
            this.cmdTimDonHang.BackgroundImageLayout = ImageLayout.Stretch;
            Point point = new Point(0xca, 9);
            this.cmdTimDonHang.Location = point;
            Padding padding = new Padding(0);
            this.cmdTimDonHang.Margin = padding;
            this.cmdTimDonHang.Name = "cmdTimDonHang";
            Size size = new Size(0x17, 0x16);
            this.cmdTimDonHang.Size = size;
            this.cmdTimDonHang.TabIndex = 2;
            this.cmdTimDonHang.UseVisualStyleBackColor = true;
            this.Label20.AutoSize = true;
            this.Label20.BackColor = Color.Transparent;
            point = new Point(0xfe, 12);
            this.Label20.Location = point;
            this.Label20.Name = "Label20";
            size = new Size(0x20, 13);
            this.Label20.Size = size;
            this.Label20.TabIndex = 3;
            this.Label20.Text = "Ng\x00e0y";
            this.TxtNgayDathang.Enabled = false;
            this.TxtNgayDathang.Format = DateTimePickerFormat.Custom;
            point = new Point(0x124, 10);
            this.TxtNgayDathang.Location = point;
            this.TxtNgayDathang.Name = "TxtNgayDathang";
            size = new Size(100, 20);
            this.TxtNgayDathang.Size = size;
            this.TxtNgayDathang.TabIndex = 4;
            this.Label21.AutoSize = true;
            this.Label21.BackColor = Color.Transparent;
            point = new Point(11, 13);
            this.Label21.Location = point;
            this.Label21.Name = "Label21";
            size = new Size(0x39, 13);
            this.Label21.Size = size;
            this.Label21.TabIndex = 0;
            this.Label21.Text = "B\x00e1o gi\x00e1 số";
            this.TxtSoBaoGia.Enabled = false;
            point = new Point(0x63, 10);
            this.TxtSoBaoGia.Location = point;
            this.TxtSoBaoGia.Name = "TxtSoBaoGia";
            this.TxtSoBaoGia.ReadOnly = true;
            size = new Size(0x67, 20);
            this.TxtSoBaoGia.Size = size;
            this.TxtSoBaoGia.TabIndex = 1;
            this.CboLoaiGia.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiGia.FormattingEnabled = true;
            point = new Point(700, 0x66);
            this.CboLoaiGia.Location = point;
            this.CboLoaiGia.Name = "CboLoaiGia";
            size = new Size(0x7b, 0x15);
            this.CboLoaiGia.Size = size;
            this.CboLoaiGia.TabIndex = 0x20;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new Point(0x278, 0x6a);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x2c, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x1f;
            this.Label3.Text = "Loại gi\x00e1";
            this.Label3.TextAlign = ContentAlignment.TopRight;
            this.Label17.AutoEllipsis = true;
            this.Label17.AutoSize = true;
            this.Label17.BackColor = Color.Transparent;
            point = new Point(0x1b4, 0x54);
            this.Label17.Location = point;
            this.Label17.Name = "Label17";
            this.Label17.RightToLeft = RightToLeft.No;
            size = new Size(0x38, 13);
            this.Label17.Size = size;
            this.Label17.TabIndex = 0x1b;
            this.Label17.Text = "Nh\x00e2n vi\x00ean";
            this.Label17.TextAlign = ContentAlignment.TopRight;
            this.Label18.AutoSize = true;
            this.Label18.BackColor = Color.Transparent;
            point = new Point(0x1b4, 0x6a);
            this.Label18.Location = point;
            this.Label18.Name = "Label18";
            size = new Size(0x37, 13);
            this.Label18.Size = size;
            this.Label18.TabIndex = 0x1d;
            this.Label18.Text = "Hợp đồng";
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 2;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.Fixed = 2;
            this.VSlist.Rows.MinSize = 20;
            size = new Size(0x37c, 0x10b);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0;
            this.VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            point = new Point(0x20d, 0x67);
            this.TxtSoHopDong.Location = point;
            this.TxtSoHopDong.Name = "TxtSoHopDong";
            size = new Size(100, 20);
            this.TxtSoHopDong.Size = size;
            this.TxtSoHopDong.TabIndex = 30;
            this.CboLienHe.FormattingEnabled = true;
            point = new Point(100, 0x66);
            this.CboLienHe.Location = point;
            this.CboLienHe.Name = "CboLienHe";
            size = new Size(0x124, 0x15);
            this.CboLienHe.Size = size;
            this.CboLienHe.TabIndex = 14;
            this.CboPhuongThucThanhToan.FormattingEnabled = true;
            point = new Point(700, 0x21);
            this.CboPhuongThucThanhToan.Location = point;
            this.CboPhuongThucThanhToan.Name = "CboPhuongThucThanhToan";
            size = new Size(0x7b, 0x15);
            this.CboPhuongThucThanhToan.Size = size;
            this.CboPhuongThucThanhToan.TabIndex = 0x16;
            this.Label7.AutoSize = true;
            this.Label7.BackColor = Color.Transparent;
            point = new Point(0x1b4, 0x24);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x4d, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x13;
            this.Label7.Text = "Hạn giao h\x00e0ng";
            this.TxtHanGiaoHang.Format = DateTimePickerFormat.Short;
            point = new Point(0x20d, 0x21);
            this.TxtHanGiaoHang.Location = point;
            this.TxtHanGiaoHang.Name = "TxtHanGiaoHang";
            size = new Size(100, 20);
            this.TxtHanGiaoHang.Size = size;
            this.TxtHanGiaoHang.TabIndex = 20;
            this.Panel5.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.Panel5.Controls.Add(this.TxtHoaHong);
            this.Panel5.Controls.Add(this.Label23);
            this.Panel5.Controls.Add(this.TxtMuaHang);
            this.Panel5.Controls.Add(this.Label22);
            this.Panel5.Controls.Add(this.TxtTienThueNT);
            this.Panel5.Controls.Add(this.Label15);
            this.Panel5.Controls.Add(this.TxtTongCongNT);
            this.Panel5.Controls.Add(this.Label14);
            this.Panel5.Controls.Add(this.TxtCongThemNT);
            this.Panel5.Controls.Add(this.Label12);
            this.Panel5.Controls.Add(this.TxtSoTienNT);
            this.Panel5.Controls.Add(this.Label5);
            this.Panel5.Dock = DockStyle.Right;
            point = new Point(0x1d8, 0);
            this.Panel5.Location = point;
            this.Panel5.Name = "Panel5";
            size = new Size(0x1a6, 0x47);
            this.Panel5.Size = size;
            this.Panel5.TabIndex = 4;
            this.TxtHoaHong.BorderStyle = BorderStyle.FixedSingle;
            this.TxtHoaHong.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x57, 0x1b);
            this.TxtHoaHong.Location = point;
            this.TxtHoaHong.Name = "TxtHoaHong";
            padding = new Padding(1);
            this.TxtHoaHong.Padding = padding;
            this.TxtHoaHong.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtHoaHong.Size = size;
            this.TxtHoaHong.TabIndex = 40;
            this.TxtHoaHong.Tag = null;
            this.TxtHoaHong.TextAlign = HorizontalAlignment.Right;
            decimal num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtHoaHong.Value = num;
            this.TxtHoaHong.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtHoaHong.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtHoaHong.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label23.AutoEllipsis = true;
            this.Label23.AutoSize = true;
            this.Label23.BackColor = Color.Transparent;
            this.Label23.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 30);
            this.Label23.Location = point;
            this.Label23.Name = "Label23";
            this.Label23.RightToLeft = RightToLeft.No;
            size = new Size(0x3a, 14);
            this.Label23.Size = size;
            this.Label23.TabIndex = 0x27;
            this.Label23.Text = "Hoa hồng";
            this.Label23.TextAlign = ContentAlignment.TopRight;
            this.TxtMuaHang.BorderStyle = BorderStyle.FixedSingle;
            this.TxtMuaHang.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x57, 4);
            this.TxtMuaHang.Location = point;
            this.TxtMuaHang.Name = "TxtMuaHang";
            padding = new Padding(1);
            this.TxtMuaHang.Padding = padding;
            this.TxtMuaHang.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtMuaHang.Size = size;
            this.TxtMuaHang.TabIndex = 6;
            this.TxtMuaHang.Tag = null;
            this.TxtMuaHang.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtMuaHang.Value = num;
            this.TxtMuaHang.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtMuaHang.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtMuaHang.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label22.AutoEllipsis = true;
            this.Label22.AutoSize = true;
            this.Label22.BackColor = Color.Transparent;
            this.Label22.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 7);
            this.Label22.Location = point;
            this.Label22.Name = "Label22";
            this.Label22.RightToLeft = RightToLeft.No;
            size = new Size(50, 14);
            this.Label22.Size = size;
            this.Label22.TabIndex = 5;
            this.Label22.Text = "Đầu v\x00e0o";
            this.Label22.TextAlign = ContentAlignment.TopRight;
            this.TxtTienThueNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThueNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x132, 0x19);
            this.TxtTienThueNT.Location = point;
            this.TxtTienThueNT.Name = "TxtTienThueNT";
            padding = new Padding(1);
            this.TxtTienThueNT.Padding = padding;
            this.TxtTienThueNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTienThueNT.Size = size;
            this.TxtTienThueNT.TabIndex = 3;
            this.TxtTienThueNT.Tag = null;
            this.TxtTienThueNT.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtTienThueNT.Value = num;
            this.TxtTienThueNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThueNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThueNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label15.AutoEllipsis = true;
            this.Label15.AutoSize = true;
            this.Label15.BackColor = Color.Transparent;
            this.Label15.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(0xe5, 0x1c);
            this.Label15.Location = point;
            this.Label15.Name = "Label15";
            this.Label15.RightToLeft = RightToLeft.No;
            size = new Size(0x3b, 14);
            this.Label15.Size = size;
            this.Label15.TabIndex = 2;
            this.Label15.Text = "Tiền thuế";
            this.Label15.TextAlign = ContentAlignment.TopRight;
            this.TxtTongCongNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongCongNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x132, 0x30);
            this.TxtTongCongNT.Location = point;
            this.TxtTongCongNT.Name = "TxtTongCongNT";
            padding = new Padding(1);
            this.TxtTongCongNT.Padding = padding;
            this.TxtTongCongNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtTongCongNT.Size = size;
            this.TxtTongCongNT.TabIndex = 5;
            this.TxtTongCongNT.Tag = null;
            this.TxtTongCongNT.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtTongCongNT.Value = num;
            this.TxtTongCongNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongCongNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongCongNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label14.AutoEllipsis = true;
            this.Label14.AutoSize = true;
            this.Label14.BackColor = Color.Transparent;
            this.Label14.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(0xe5, 0x34);
            this.Label14.Location = point;
            this.Label14.Name = "Label14";
            this.Label14.RightToLeft = RightToLeft.No;
            size = new Size(0x41, 14);
            this.Label14.Size = size;
            this.Label14.TabIndex = 4;
            this.Label14.Text = "Tổng cộng";
            this.Label14.TextAlign = ContentAlignment.TopRight;
            this.TxtCongThemNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x57, 130);
            this.TxtCongThemNT.Location = point;
            this.TxtCongThemNT.Name = "TxtCongThemNT";
            this.TxtCongThemNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtCongThemNT.Size = size;
            this.TxtCongThemNT.TabIndex = 0x26;
            this.TxtCongThemNT.Tag = null;
            this.TxtCongThemNT.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtCongThemNT.Value = num;
            this.TxtCongThemNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.Label12.AutoEllipsis = true;
            this.Label12.AutoSize = true;
            this.Label12.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(10, 0x86);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            this.Label12.RightToLeft = RightToLeft.No;
            size = new Size(0x44, 14);
            this.Label12.Size = size;
            this.Label12.TabIndex = 0x25;
            this.Label12.Text = "&Cộng th\x00eam";
            this.Label12.TextAlign = ContentAlignment.TopRight;
            this.TxtSoTienNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoTienNT.FormatType = FormatTypeEnum.StandardNumber;
            point = new Point(0x132, 2);
            this.TxtSoTienNT.Location = point;
            this.TxtSoTienNT.Name = "TxtSoTienNT";
            padding = new Padding(1);
            this.TxtSoTienNT.Padding = padding;
            this.TxtSoTienNT.ReadOnly = true;
            size = new Size(0x6d, 20);
            this.TxtSoTienNT.Size = size;
            this.TxtSoTienNT.TabIndex = 1;
            this.TxtSoTienNT.Tag = null;
            this.TxtSoTienNT.TextAlign = HorizontalAlignment.Right;
            num = new decimal(new int[] { 0, 0, 0, 0 });
            this.TxtSoTienNT.Value = num;
            this.TxtSoTienNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtSoTienNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoTienNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label5.AutoEllipsis = true;
            this.Label5.AutoSize = true;
            this.Label5.BackColor = Color.Transparent;
            this.Label5.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0xa3);
            point = new Point(0xe5, 5);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            this.Label5.RightToLeft = RightToLeft.No;
            size = new Size(0x3d, 14);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0;
            this.Label5.Text = "Tiền h\x00e0ng";
            this.Label5.TextAlign = ContentAlignment.TopRight;
            this.CmdAddRow.Image = (Image) manager.GetObject("CmdAddRow.Image");
            this.CmdAddRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(3, 4);
            this.CmdAddRow.Location = point;
            this.CmdAddRow.Name = "CmdAddRow";
            size = new Size(0x5c, 0x18);
            this.CmdAddRow.Size = size;
            this.CmdAddRow.TabIndex = 0;
            this.CmdAddRow.Text = "&1.Th\x00eam d\x00f2ng";
            this.CmdAddRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdAddRow.UseVisualStyleBackColor = true;
            this.Label8.AutoSize = true;
            this.Label8.BackColor = Color.Transparent;
            point = new Point(0x275, 0x25);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x3e, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x15;
            this.Label8.Text = "Thanh to\x00e1n";
            this.Label8.TextAlign = ContentAlignment.TopRight;
            this.CmdDelRow.Image = (Image) manager.GetObject("CmdDelRow.Image");
            this.CmdDelRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(100, 4);
            this.CmdDelRow.Location = point;
            this.CmdDelRow.Name = "CmdDelRow";
            size = new Size(0x59, 0x18);
            this.CmdDelRow.Size = size;
            this.CmdDelRow.TabIndex = 1;
            this.CmdDelRow.Text = "&2.X\x00f3a d\x00f2ng";
            this.CmdDelRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdDelRow.UseVisualStyleBackColor = true;
            this.Label19.AutoSize = true;
            this.Label19.BackColor = Color.Transparent;
            point = new Point(0xc3, 10);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            size = new Size(0x37, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 2;
            this.Label19.Text = "T\x00ecnh trạng";
            this.Panel4.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.Panel4.Controls.Add(this.TxtSoLuong);
            this.Panel4.Controls.Add(this.CboTinhTrang);
            this.Panel4.Controls.Add(this.Label19);
            this.Panel4.Controls.Add(this.CmdDelRow);
            this.Panel4.Controls.Add(this.CmdAddRow);
            this.Panel4.Controls.Add(this.Panel5);
            this.Panel4.Dock = DockStyle.Bottom;
            point = new Point(0, 0x1f1);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x37e, 0x47);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 40;
            this.TxtSoLuong.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoLuong.DataType = typeof(double);
            this.TxtSoLuong.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x184, 0x4b);
            this.TxtSoLuong.Location = point;
            this.TxtSoLuong.Name = "TxtSoLuong";
            padding = new Padding(1);
            this.TxtSoLuong.Padding = padding;
            size = new Size(0x55, 20);
            this.TxtSoLuong.Size = size;
            this.TxtSoLuong.TabIndex = 0xa4;
            this.TxtSoLuong.Tag = null;
            this.TxtSoLuong.TextAlign = HorizontalAlignment.Right;
            this.TxtSoLuong.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.TxtSoLuong.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoLuong.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.CboTinhTrang.FormattingEnabled = true;
            point = new Point(0x105, 7);
            this.CboTinhTrang.Location = point;
            this.CboTinhTrang.Name = "CboTinhTrang";
            size = new Size(0x79, 0x15);
            this.CboTinhTrang.Size = size;
            this.CboTinhTrang.TabIndex = 3;
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.CmdHelp, this.CmdXacNhan });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x37e, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x4d, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdPrint.DropDownItems.AddRange(new ToolStripItem[] { this.CmdInTiengViet, this.CmdInTiengAnh, this.mnInPhanTinhLoiNhuan });
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x31, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.CmdInTiengViet.Name = "CmdInTiengViet";
            size = new Size(0xb1, 0x16);
            this.CmdInTiengViet.Size = size;
            this.CmdInTiengViet.Text = "Tiếng Việt";
            this.CmdInTiengAnh.Name = "CmdInTiengAnh";
            size = new Size(0xb1, 0x16);
            this.CmdInTiengAnh.Size = size;
            this.CmdInTiengAnh.Text = "Tiếng Anh";
            this.mnInPhanTinhLoiNhuan.Name = "mnInPhanTinhLoiNhuan";
            size = new Size(0xb1, 0x16);
            this.mnInPhanTinhLoiNhuan.Size = size;
            this.mnInPhanTinhLoiNhuan.Text = "Ph\x00e2n t\x00edch lợi nhuận";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdHelp.Alignment = ToolStripItemAlignment.Right;
            this.CmdHelp.Image = (Image) manager.GetObject("CmdHelp.Image");
            this.CmdHelp.ImageTransparentColor = Color.Magenta;
            this.CmdHelp.Name = "CmdHelp";
            size = new Size(0x34, 0x16);
            this.CmdHelp.Size = size;
            this.CmdHelp.Text = "&Help";
            this.CmdXacNhan.Image = ACCOUNTING.My.Resources.Resources.Selected;
            this.CmdXacNhan.ImageTransparentColor = Color.White;
            this.CmdXacNhan.Name = "CmdXacNhan";
            size = new Size(0x3a, 0x16);
            this.CmdXacNhan.Size = size;
            this.CmdXacNhan.Text = "Duyệt";
            point = new Point(100, 0x4f);
            this.TxtDiaChiGiaoHang.Location = point;
            this.TxtDiaChiGiaoHang.Name = "TxtDiaChiGiaoHang";
            size = new Size(0x124, 20);
            this.TxtDiaChiGiaoHang.Size = size;
            this.TxtDiaChiGiaoHang.TabIndex = 12;
            this.TxtNgayThanhToan.Format = DateTimePickerFormat.Short;
            point = new Point(0x20d, 0x38);
            this.TxtNgayThanhToan.Location = point;
            this.TxtNgayThanhToan.Name = "TxtNgayThanhToan";
            size = new Size(0x65, 20);
            this.TxtNgayThanhToan.Size = size;
            this.TxtNgayThanhToan.TabIndex = 0x18;
            this.AdvNhanVien.Conditions = "";
            this.AdvNhanVien.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            point = new Point(0x20d, 80);
            this.AdvNhanVien.Location = point;
            this.AdvNhanVien.Name = "AdvNhanVien";
            this.AdvNhanVien.ReadOnly = false;
            size = new Size(0x12a, 20);
            this.AdvNhanVien.Size = size;
            this.AdvNhanVien.TabIndex = 0x1c;
            this.AdvNhanVien.UpperText = true;
            this.AdvNhanVien.Value = "";
            this.AdvNhanVien.WidthCode = 80;
            this.Label6.AutoEllipsis = true;
            this.Label6.AutoSize = true;
            this.Label6.BackColor = Color.Transparent;
            point = new Point(11, 0x53);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            this.Label6.RightToLeft = RightToLeft.No;
            size = new Size(90, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 11;
            this.Label6.Text = "Địa chỉ giao h\x00e0ng";
            this.Label6.TextAlign = ContentAlignment.TopRight;
            this.CboPhuongThucVanChuyen.FormattingEnabled = true;
            point = new Point(0x20d, 9);
            this.CboPhuongThucVanChuyen.Location = point;
            this.CboPhuongThucVanChuyen.Name = "CboPhuongThucVanChuyen";
            size = new Size(0x12a, 0x15);
            this.CboPhuongThucVanChuyen.Size = size;
            this.CboPhuongThucVanChuyen.TabIndex = 0x12;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new Point(0x1b4, 14);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x40, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x11;
            this.Label4.Text = "Vận chuyển";
            this.Label4.TextAlign = ContentAlignment.TopRight;
            this.Label2.AutoEllipsis = true;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(11, 0x6a);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            this.Label2.RightToLeft = RightToLeft.No;
            size = new Size(0x45, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 13;
            this.Label2.Text = "Người li\x00ean hệ";
            this.Label2.TextAlign = ContentAlignment.TopRight;
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            this.Label16.BackColor = Color.Transparent;
            point = new Point(11, 0x3b);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x41, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 9;
            this.Label16.Text = "Kh\x00e1ch h\x00e0ng";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.AdvKhachHang.Conditions = "";
            this.AdvKhachHang.LoaiDoiTuong = modGeneral.TypeObjects.KhachHang;
            point = new Point(100, 0x38);
            this.AdvKhachHang.Location = point;
            this.AdvKhachHang.Name = "AdvKhachHang";
            this.AdvKhachHang.ReadOnly = false;
            size = new Size(0x124, 20);
            this.AdvKhachHang.Size = size;
            this.AdvKhachHang.TabIndex = 10;
            this.AdvKhachHang.UpperText = true;
            this.AdvKhachHang.Value = "";
            this.AdvKhachHang.WidthCode = 80;
            point = new Point(100, 0x7e);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x2d3, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 0x10;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            this.Label9.BackColor = Color.Transparent;
            point = new Point(11, 0x81);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x30, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 15;
            this.Label9.Text = "Diễn giải";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x2bd, 0x38);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x7a, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 0x1a;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x295, 0x9c);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            padding = new Padding(1);
            this.txtTyGia.Padding = padding;
            size = new Size(0x7b, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 0x22;
            this.txtTyGia.Tag = null;
            this.txtTyGia.TextAlign = HorizontalAlignment.Right;
            this.txtTyGia.Visible = false;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.txtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.txtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label11.AutoSize = true;
            this.Label11.BackColor = Color.Transparent;
            point = new Point(0x278, 0x3b);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 0x19;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            point = new Point(0x251, 160);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 0x21;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label10.Visible = false;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new Point(0xfe, 0x24);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 7;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Short;
            point = new Point(0x124, 0x21);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(100, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 8;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(11, 0x24);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 5;
            this.Label1.Text = "Số chứng từ";
            point = new Point(100, 0x21);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x66, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 6;
            this.Label24.AutoSize = true;
            this.Label24.BackColor = Color.Transparent;
            point = new Point(0x1b4, 60);
            this.Label24.Location = point;
            this.Label24.Name = "Label24";
            size = new Size(0x56, 13);
            this.Label24.Size = size;
            this.Label24.TabIndex = 0x17;
            this.Label24.Text = "Ng\x00e0y thanh to\x00e1n";
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage1);
            this.C1DockingTab1.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.C1DockingTab1.Location = point;
            this.C1DockingTab1.Name = "C1DockingTab1";
            this.C1DockingTab1.SelectedIndex = 1;
            size = new Size(0x37e, 0xb3);
            this.C1DockingTab1.Size = size;
            this.C1DockingTab1.TabIndex = 1;
            this.C1DockingTab1.TabsSpacing = 5;
            this.C1DockingTab1.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab1.VisualStyle = C1.Win.C1Command.VisualStyle.Custom;
            this.C1DockingTab1.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage1.Controls.Add(this.TxtNgayThanhToan);
            this.C1DockingTabPage1.Controls.Add(this.Label21);
            this.C1DockingTabPage1.Controls.Add(this.cmdTimDonHang);
            this.C1DockingTabPage1.Controls.Add(this.Label24);
            this.C1DockingTabPage1.Controls.Add(this.Label20);
            this.C1DockingTabPage1.Controls.Add(this.TxtSoChungTu);
            this.C1DockingTabPage1.Controls.Add(this.TxtNgayDathang);
            this.C1DockingTabPage1.Controls.Add(this.Label1);
            this.C1DockingTabPage1.Controls.Add(this.TxtNgayChungTu);
            this.C1DockingTabPage1.Controls.Add(this.TxtSoBaoGia);
            this.C1DockingTabPage1.Controls.Add(this.Label13);
            this.C1DockingTabPage1.Controls.Add(this.CboLoaiGia);
            this.C1DockingTabPage1.Controls.Add(this.Label3);
            this.C1DockingTabPage1.Controls.Add(this.Label11);
            this.C1DockingTabPage1.Controls.Add(this.Label17);
            this.C1DockingTabPage1.Controls.Add(this.AdvNhanVien);
            this.C1DockingTabPage1.Controls.Add(this.CboLoaiTien);
            this.C1DockingTabPage1.Controls.Add(this.Label18);
            this.C1DockingTabPage1.Controls.Add(this.Label9);
            this.C1DockingTabPage1.Controls.Add(this.TxtSoHopDong);
            this.C1DockingTabPage1.Controls.Add(this.TxtDienGiai);
            this.C1DockingTabPage1.Controls.Add(this.CboLienHe);
            this.C1DockingTabPage1.Controls.Add(this.AdvKhachHang);
            this.C1DockingTabPage1.Controls.Add(this.CboPhuongThucThanhToan);
            this.C1DockingTabPage1.Controls.Add(this.Label16);
            this.C1DockingTabPage1.Controls.Add(this.Label8);
            this.C1DockingTabPage1.Controls.Add(this.Label2);
            this.C1DockingTabPage1.Controls.Add(this.Label7);
            this.C1DockingTabPage1.Controls.Add(this.Label4);
            this.C1DockingTabPage1.Controls.Add(this.TxtHanGiaoHang);
            this.C1DockingTabPage1.Controls.Add(this.CboPhuongThucVanChuyen);
            this.C1DockingTabPage1.Controls.Add(this.TxtDiaChiGiaoHang);
            this.C1DockingTabPage1.Controls.Add(this.Label6);
            this.C1DockingTabPage1.Controls.Add(this.Label10);
            this.C1DockingTabPage1.Controls.Add(this.txtTyGia);
            this.C1DockingTabPage1.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage1.Location = point;
            this.C1DockingTabPage1.Name = "C1DockingTabPage1";
            size = new Size(0x37c, 0x99);
            this.C1DockingTabPage1.Size = size;
            this.C1DockingTabPage1.TabIndex = 0;
            this.C1DockingTabPage1.Text = "Th\x00f4ng tin đơn đặt h\x00e0ng";
            this.C1DockingTab2.Controls.Add(this.C1DockingTabPage2);
            this.C1DockingTab2.Dock = DockStyle.Fill;
            point = new Point(0, 0xcc);
            this.C1DockingTab2.Location = point;
            this.C1DockingTab2.Name = "C1DockingTab2";
            this.C1DockingTab2.SelectedIndex = 1;
            size = new Size(0x37e, 0x125);
            this.C1DockingTab2.Size = size;
            this.C1DockingTab2.TabIndex = 2;
            this.C1DockingTab2.TabsSpacing = 5;
            this.C1DockingTab2.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab2.VisualStyle = C1.Win.C1Command.VisualStyle.Custom;
            this.C1DockingTab2.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage2.Controls.Add(this.VSlist);
            this.C1DockingTabPage2.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage2.Location = point;
            this.C1DockingTabPage2.Name = "C1DockingTabPage2";
            size = new Size(0x37c, 0x10b);
            this.C1DockingTabPage2.Size = size;
            this.C1DockingTabPage2.TabIndex = 0;
            this.C1DockingTabPage2.Text = "Chi tiết h\x00e0ng h\x00f3a";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x238);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.C1DockingTab2);
            this.Controls.Add(this.C1DockingTab1);
            this.Controls.Add(this.Panel4);
            this.Controls.Add(this.ToolStrip1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.Name = "Frm_SaleOrder";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BH-0003  ";
            this.Text = "DON DAT HANG BAN";
            this.VSlist.EndInit();
            this.Panel5.ResumeLayout(false);
            this.Panel5.PerformLayout();
            ((ISupportInitialize) this.TxtHoaHong).EndInit();
            ((ISupportInitialize) this.TxtMuaHang).EndInit();
            ((ISupportInitialize) this.TxtTienThueNT).EndInit();
            ((ISupportInitialize) this.TxtTongCongNT).EndInit();
            ((ISupportInitialize) this.TxtCongThemNT).EndInit();
            ((ISupportInitialize) this.TxtSoTienNT).EndInit();
            this.Panel4.ResumeLayout(false);
            this.Panel4.PerformLayout();
            ((ISupportInitialize) this.TxtSoLuong).EndInit();
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            ((ISupportInitialize) this.txtTyGia).EndInit();
            ((ISupportInitialize) this.C1DockingTab1).EndInit();
            this.C1DockingTab1.ResumeLayout(false);
            this.C1DockingTabPage1.ResumeLayout(false);
            this.C1DockingTabPage1.PerformLayout();
            ((ISupportInitialize) this.C1DockingTab2).EndInit();
            this.C1DockingTab2.ResumeLayout(false);
            this.C1DockingTabPage2.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void InsertBaoGia(string strKhoa)
        {
            ClsBaoGia gia = new ClsBaoGia();
            gia.Load(strKhoa);
            this.TxtSoBaoGia.Text = gia.SoChungTu;
            this.TxtSoBaoGia.Tag = gia.Khoa;
            this.TxtNgayDathang.Text = LVYModule.Char2Date(gia.NgayChungTu);
            this.AdvKhachHang.Value = gia.KhoaKhachHang;
            this.CboLoaiGia.SelectedValue = gia.KhoaLoaiGia;
            this.CboLoaiTien.SelectedValue = gia.LoaiTien;
            this.txtTyGia.Value = gia.TyGia;
            DataTable details = gia.GetDetails(strKhoa);
            if (details != null)
            {
                int num2 = details.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = "";
                    vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(details.Rows[i]["MaHang"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TenHang"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaDVT"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DVT"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(details.Rows[i]["QuyCach"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLuong"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DonGia"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienHang"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["ThueSuat"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienThue"]);
                    vSlist = null;
                }
                this.TinhTong();
            }
        }

        public void MergCell()
        {
            int num2;
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Rows[0].AllowMerging = true;
            vSlist.AllowMerging = AllowMergingEnum.FixedOnly;
            int num = 0;
            do
            {
                vSlist[1, num] = RuntimeHelpers.GetObjectValue(vSlist[0, num]);
                vSlist.Cols[num].AllowMerging = true;
                num++;
                num2 = 7;
            }
            while (num <= num2);
            num = 0x12;
            do
            {
                vSlist[1, num] = RuntimeHelpers.GetObjectValue(vSlist[0, num]);
                vSlist.Cols[num].AllowMerging = true;
                num++;
                num2 = 0x13;
            }
            while (num <= num2);
            vSlist[1, 8] = modGeneral.Tranlated("Đơn gi\x00e1", "");
            vSlist[1, 9] = modGeneral.Tranlated("Th\x00e0nh tiền", "");
            vSlist[1, 11] = modGeneral.Tranlated("Nh\x00e0 cung cấp", "");
            vSlist[1, 12] = modGeneral.Tranlated("Đơn gi\x00e1", "");
            vSlist[1, 13] = modGeneral.Tranlated("Th\x00e0nh tiền", "");
            vSlist[1, 14] = modGeneral.Tranlated("Thuế suất", "");
            vSlist[1, 15] = modGeneral.Tranlated("Tiền thuế", "");
            vSlist[1, 0x10] = modGeneral.Tranlated("(%)", "");
            vSlist[1, 0x11] = modGeneral.Tranlated("Th\x00e0nh tiền", "");
            vSlist = null;
        }

        private void mnInPhanTinhLoiNhuan_Click(object sender, EventArgs e)
        {
            ReportModule.PrintPhanTichDonHang(this.cFrmKhoa, "VIET");
        }

        public bool SaveTemp()
        {
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            int num2 = this.VSlist.Rows.Count - 1;
            for (int i = 2; i <= num2; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    vSlist[i, 0] = modGeneral.CreatKey("BH_DonDatHangChiTiet", 15, "");
                }
                this.objDHCT.Khoa = Conversions.ToString(vSlist[i, 0]);
                this.objDHCT.KhoaDonDatHang = this.cFrmKhoa;
                this.objDHCT.KhoaHangHoa = Conversions.ToString(vSlist[i, 1]);
                this.objDHCT.KhoaDonViTinh = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 4]), "", modGeneral.TypeOfValue.Nothing).ToString();
                this.objDHCT.QuyCach = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 6]), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.SoLuong = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 7]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.GiaMuaNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 8]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.GiaMua = this.objDHCT.GiaMuaNT * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.TienMuaNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 9]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.TienMua = this.objDHCT.TienMuaNT * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.KhoaNhaCungCap = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 10]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                this.objDHCT.DonGiaNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.DonGia = this.objDHCT.DonGiaNT * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.ThanhTienNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 13]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.ThanhTien = this.objDHCT.ThanhTienNT * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.SoLuongCungCap = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.ThueSuat = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 14]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.TienThueNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.TienThue = this.objDHCT.TienThueNT * Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.TriGiaCungCapNT = 0.0;
                this.objDHCT.TriGiaCungCap = 0.0;
                this.objDHCT.TyLeHoaHong = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.HoaHongNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSlist[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
                this.objDHCT.HoaHong = this.objDHCT.HoaHongNT;
                if (!this.objDHCT.Save())
                {
                    return false;
                }
            }
            vSlist = null;
            return true;
        }

        public void ShowData(string strKhoa)
        {
            this.objDH.Load(strKhoa);
            clsDonDatHang objDH = this.objDH;
            this.cFrmKhoa = objDH.Khoa;
            this.TxtSoChungTu.Text = objDH.SoChungTu;
            this.TxtNgayChungTu.Text = LVYModule.Char2Date(objDH.NgayChungTu);
            this.AdvKhachHang.Value = objDH.KhoaDoiTuong;
            this.CboLienHe.Text = objDH.NguoiLienHe;
            this.TxtHanGiaoHang.Text = LVYModule.Char2Date(objDH.NgayCungCap);
            this.AdvNhanVien.Value = objDH.KhoaNhanVien;
            this.TxtDiaChiGiaoHang.Text = objDH.DiaChiGiaoHang;
            this.TxtSoHopDong.Text = objDH.SoHopDong;
            this.CboPhuongThucVanChuyen.SelectedValue = objDH.PhuongThucGiaoHang;
            this.CboPhuongThucThanhToan.SelectedValue = objDH.PhuongThucThanhToan;
            this.TxtDienGiai.Text = objDH.DienGiai;
            this.CboLoaiTien.SelectedValue = objDH.LoaiTien;
            this.txtTyGia.Value = objDH.TyGia;
            this.TxtSoTienNT.Value = objDH.TienHangNT;
            this.TxtTienThueNT.Value = objDH.TienThueNT;
            this.TxtCongThemNT.Value = objDH.TienPhiNT;
            this.TxtTongCongNT.Value = (objDH.TienHangNT + objDH.TienThueNT) + objDH.TienPhiNT;
            this.CboTinhTrang.SelectedValue = objDH.TinhTrang;
            this.CboLoaiGia.SelectedValue = objDH.KhoaLoaiGia;
            this.TxtMuaHang.Value = objDH.DauVaoNT;
            this.TxtHoaHong.Value = objDH.HoaHongNT;
            this.TxtNgayThanhToan.Text = LVYModule.Char2Date(objDH.NgayHangVeKho);
            objDH = null;
            this.VSlist.Rows.Count = 2;
            DataTable details = this.objDH.GetDetails(strKhoa);
            if (details != null)
            {
                int num2 = details.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
                    vSlist.AddItem("");
                    vSlist[vSlist.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(details.Rows[i]["Khoa"]);
                    vSlist[vSlist.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaHangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(details.Rows[i]["MaHang"]);
                    vSlist[vSlist.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(details.Rows[i]["HangHoa"]);
                    vSlist[vSlist.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaDonViTinh"]);
                    vSlist[vSlist.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DonViTinh"]);
                    vSlist[vSlist.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(details.Rows[i]["QuyCach"]);
                    vSlist[vSlist.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLuong"]);
                    vSlist[vSlist.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(details.Rows[i]["GiaMuaNT"]);
                    vSlist[vSlist.Rows.Count - 1, 9] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienMuaNT"]);
                    vSlist[vSlist.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["KhoaNhaCungCap"]);
                    vSlist[vSlist.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["NhaCungCap"]);
                    vSlist[vSlist.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["DonGiaNT"]);
                    vSlist[vSlist.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(details.Rows[i]["ThanhTienNT"]);
                    vSlist[vSlist.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(details.Rows[i]["ThueSuat"]);
                    vSlist[vSlist.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TienThueNT"]);
                    vSlist[vSlist.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(details.Rows[i]["TyLeHoaHong"]);
                    vSlist[vSlist.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(details.Rows[i]["HoaHongNT"]);
                    vSlist[vSlist.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(details.Rows[i]["SoLuongCungCap"]);
                    this.TinhSoLuongChuaNhap(vSlist.Rows.Count - 1);
                    vSlist = null;
                }
            }
        }

        public void TinhHoaHong(int nRow)
        {
            double num = 0.0;
            int num2 = 0;
            num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing)) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 15]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 0x11] = Math.Round((double) ((num * num2) / 100.0), this.ObjLT.SoLe);
        }

        public void TinhSoLuongChuaNhap(int nRow)
        {
            double num2 = 0.0;
            double num = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 7]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 0x13] = num2 - num;
        }

        public void TinhTienHang(int nRow)
        {
            double num = 0.0;
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 7]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 12]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 13] = num2 * num;
        }

        public void TinhTienHangNhaCungCap(int nRow)
        {
            double num = 0.0;
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 7]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 8]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 9] = num2 * num;
        }

        public void TinhTienThue(int nRow)
        {
            double num2 = 0.0;
            int num = 0;
            num = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 14]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            this.VSlist[nRow, 15] = Math.Round((double) ((num2 * num) / 100.0), this.ObjLT.SoLe);
        }

        public void TinhTong()
        {
            this.TxtSoTienNT.Value = LVYModule.SumColGrid(this.VSlist, 13);
            this.TxtTienThueNT.Value = LVYModule.SumColGrid(this.VSlist, 15);
            this.TxtTongCongNT.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoTienNT.Value), 0, modGeneral.TypeOfValue.Nothing)) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtCongThemNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtMuaHang.Value = LVYModule.SumColGrid(this.VSlist, 9);
            this.TxtHoaHong.Value = LVYModule.SumColGrid(this.VSlist, 0x11);
        }

        private void TxtCongThemNT_LostFocus(object sender, EventArgs e)
        {
            this.TinhTong();
        }

        public bool UpdateData()
        {
            bool flag=false;
            clsDonDatHang objDH = this.objDH;
            objDH.KhoaBaoGia = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtSoBaoGia.Tag), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objDH.Khoa = this.cFrmKhoa;
            objDH.SoChungTu = this.TxtSoChungTu.Text.Trim();
            objDH.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objDH.KhoaDoiTuong = this.AdvKhachHang.Value;
            objDH.NguoiLienHe = this.CboLienHe.Text.Trim();
            objDH.NgayCungCap = LVYModule.Date2Char(this.TxtHanGiaoHang.Text);
            objDH.HanGiaoCuoi = LVYModule.Date2Char(this.TxtHanGiaoHang.Text);
            objDH.KhoaNhanVien = this.AdvNhanVien.Value;
            objDH.DiaChiGiaoHang = this.TxtDiaChiGiaoHang.Text.Trim();
            objDH.SoHopDong = this.TxtSoHopDong.Text.Trim();
            objDH.PhuongThucGiaoHang = Conversions.ToString(this.CboPhuongThucVanChuyen.SelectedValue);
            objDH.PhuongThucThanhToan = Conversions.ToString(this.CboPhuongThucThanhToan.SelectedValue);
            objDH.DienGiai = this.TxtDienGiai.Text.Trim();
            objDH.LoaiChungTu = "SO";
            objDH.LoaiTien = Conversions.ToString(this.CboLoaiTien.SelectedValue);
            objDH.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            objDH.TienHangNT = Conversions.ToDouble(this.TxtSoTienNT.Value);
            objDH.TienThueNT = Conversions.ToDouble(this.TxtTienThueNT.Value);
            objDH.TienPhiNT = Conversions.ToDouble(this.TxtCongThemNT.Value);
            objDH.KhoaDonVi = modGeneral.H_CLIENT;
            if (objDH.KhoaNhanVienTao.Trim() == "")
            {
                objDH.KhoaNhanVienTao = modGeneral.H_USERID;
            }
            if (objDH.NgayTao.Trim() == "")
            {
                objDH.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            }
            objDH.KhoaNhanVienSua = modGeneral.H_USERID;
            objDH.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objDH.TinhTrang = Conversions.ToString(this.CboTinhTrang.SelectedValue);
            objDH.KhoaLoaiGia = Conversions.ToString(this.CboLoaiGia.SelectedValue);
            objDH.DauVaoNT = Conversions.ToDouble(this.TxtMuaHang.Value);
            objDH.DauVao = objDH.DauVaoNT;
            objDH.HoaHongNT = Conversions.ToDouble(this.TxtHoaHong.Value);
            objDH.HoaHong = objDH.HoaHongNT;
            objDH.NgayHangVeKho = LVYModule.Date2Char(this.TxtNgayThanhToan.Text);
            return objDH.Save();
            objDH = null;
            return flag;
        }

        private void VSlist_AfterEdit(object sender, RowColEventArgs e)
        {
            switch (e.Col)
            {
                case 7:
                    this.TinhTienHangNhaCungCap(e.Row);
                    this.TinhTienHang(e.Row);
                    this.TinhTienThue(e.Row);
                    this.TinhHoaHong(e.Row);
                    this.TinhSoLuongChuaNhap(e.Row);
                    break;

                case 8:
                    this.TinhTienHangNhaCungCap(e.Row);
                    this.TinhSoLuongChuaNhap(e.Row);
                    break;

                case 12:
                    this.TinhTienHang(e.Row);
                    this.TinhTienThue(e.Row);
                    this.TinhHoaHong(e.Row);
                    break;

                case 14:
                    this.TinhTienThue(e.Row);
                    this.TinhHoaHong(e.Row);
                    break;

                case 15:
                case 0x10:
                    this.TinhHoaHong(e.Row);
                    break;
            }
            this.TinhTong();
        }

        private void VSlist_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if (((e.Col == 3) | (e.Col == 4)) | (e.Col == 6))
            {
                e.Cancel = true;
            }
        }

        private void VSlist_CellButtonClick(object sender, RowColEventArgs e)
        {
            object obj2;
            string expression = "";
            switch (e.Col)
            {
                case 2:
                {
                    expression = SearchModule.SearchHangHoa("", "", "");
                    if (expression.Trim() != "")
                    {
                        obj2 = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                        this.VSlist[e.Row, 1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null));
                        this.VSlist[e.Row, 2] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null));
                        this.VSlist[e.Row, 3] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 2 }, null));
                        clsDMHangHoa hoa = new clsDMHangHoa();
                        hoa.Load(Conversions.ToString(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null)));
                        DataTable hangHoa = hoa.GetHangHoa(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null).ToString());
                        this.VSlist[e.Row, 4] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["KhoaDonViTinh"]);
                        this.VSlist[e.Row, 5] = RuntimeHelpers.GetObjectValue(hangHoa.Rows[0]["DonViTinh"]);
                        this.VSlist[e.Row, 6] = 1;
                        this.VSlist[e.Row, 7] = 1;
                        this.VSlist[e.Row, 8] = 0;
                        this.VSlist[e.Row, 9] = 0;
                        this.VSlist[e.Row, 12] = 0;
                        this.VSlist[e.Row, 13] = 0;
                        this.VSlist[e.Row, 14] = hoa.TyLeThue;
                    }
                    double giaBan = new clsGiaBan().GetGiaBan(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), Conversions.ToString(this.CboLoaiGia.SelectedValue));
                    this.VSlist[e.Row, 12] = giaBan;
                    break;
                }
                case 5:
                    obj2 = SearchModule.SearchDVT(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), this.VSlist, e.Row, e.Col, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSlist[e.Row, 4]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (obj2 != null)
                    {
                        if (Information.UBound((Array) obj2, 1) >= 2)
                        {
                            this.VSlist[e.Row, 4] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null));
                            this.VSlist[e.Row, 5] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null));
                            this.VSlist[e.Row, 6] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 2 }, null));
                        }
                        break;
                    }
                    break;

                case 11:
                    expression = SearchModule.SearchDoiTuong("", "S", "");
                    if (expression.Trim() != "")
                    {
                        obj2 = expression.Split(new char[] { '|' });
                        this.VSlist[e.Row, 10] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null));
                        this.VSlist[e.Row, 11] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 2 }, null));
                    }
                    this.VSlist.Select(e.Row, 7);
                    break;
            }
        }

        internal virtual ADVObjects AdvKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvNhaCungCap_ValueChanged);
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged -= handler;
                }
                this._AdvKhachHang = value;
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVObjects AdvNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvNhanVien = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual ComboBox CboLienHe
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLienHe;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._CboLienHe != null)
                {
                    this._CboLienHe.KeyDown -= handler;
                }
                this._CboLienHe = value;
                if (this._CboLienHe != null)
                {
                    this._CboLienHe.KeyDown += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiGia = value;
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                KeyEventHandler handler2 = new KeyEventHandler(this.Frm_KeyDown);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                    this._CboLoaiTien.KeyDown -= handler2;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                    this._CboLoaiTien.KeyDown += handler2;
                }
            }
        }

        internal virtual ComboBox CboPhuongThucThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboPhuongThucThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._CboPhuongThucThanhToan != null)
                {
                    this._CboPhuongThucThanhToan.KeyDown -= handler;
                }
                this._CboPhuongThucThanhToan = value;
                if (this._CboPhuongThucThanhToan != null)
                {
                    this._CboPhuongThucThanhToan.KeyDown += handler;
                }
            }
        }

        internal virtual ComboBox CboPhuongThucVanChuyen
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboPhuongThucVanChuyen;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._CboPhuongThucVanChuyen != null)
                {
                    this._CboPhuongThucVanChuyen.KeyDown -= handler;
                }
                this._CboPhuongThucVanChuyen = value;
                if (this._CboPhuongThucVanChuyen != null)
                {
                    this._CboPhuongThucVanChuyen.KeyDown += handler;
                }
            }
        }

        internal virtual ComboBox CboTinhTrang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboTinhTrang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboTinhTrang = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDelRow_Click);
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click -= handler;
                }
                this._CmdDelRow = value;
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdHelp = value;
            }
        }

        internal virtual ToolStripMenuItem CmdInTiengAnh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdInTiengAnh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdInTiengAnh_Click);
                if (this._CmdInTiengAnh != null)
                {
                    this._CmdInTiengAnh.Click -= handler;
                }
                this._CmdInTiengAnh = value;
                if (this._CmdInTiengAnh != null)
                {
                    this._CmdInTiengAnh.Click += handler;
                }
            }
        }

        internal virtual ToolStripMenuItem CmdInTiengViet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdInTiengViet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdInTiengViet_Click);
                if (this._CmdInTiengViet != null)
                {
                    this._CmdInTiengViet.Click -= handler;
                }
                this._CmdInTiengViet = value;
                if (this._CmdInTiengViet != null)
                {
                    this._CmdInTiengViet.Click += handler;
                }
            }
        }

        internal virtual ToolStripSplitButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_ButtonClick);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.ButtonClick -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.ButtonClick += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button cmdTimDonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmdTimDonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmdTimDonHang_Click);
                if (this._cmdTimDonHang != null)
                {
                    this._cmdTimDonHang.Click -= handler;
                }
                this._cmdTimDonHang = value;
                if (this._cmdTimDonHang != null)
                {
                    this._cmdTimDonHang.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdXacNhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdXacNhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdXacNhan_Click);
                if (this._CmdXacNhan != null)
                {
                    this._CmdXacNhan.Click -= handler;
                }
                this._CmdXacNhan = value;
                if (this._CmdXacNhan != null)
                {
                    this._CmdXacNhan.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdAddRow.Enabled = value;
                this.CmdDelRow.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.AdvKhachHang.ReadOnly = !value;
                this.CboLienHe.Enabled = value;
                this.CboPhuongThucVanChuyen.Enabled = value;
                this.CboPhuongThucThanhToan.Enabled = value;
                this.TxtDiaChiGiaoHang.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.TxtHanGiaoHang.Enabled = value;
                this.TxtSoHopDong.ReadOnly = !value;
                this.AdvNhanVien.ReadOnly = !value;
                this.TxtCongThemNT.ReadOnly = !value;
                this.CboTinhTrang.Enabled = value;
                this.CboLoaiGia.Enabled = value;
                this.TxtNgayThanhToan.Enabled = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label14
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label14;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label14 = value;
            }
        }

        internal virtual Label Label15
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label15;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label15 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label17
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label17;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label17 = value;
            }
        }

        internal virtual Label Label18
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label18;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label18 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label20
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label20;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label20 = value;
            }
        }

        internal virtual Label Label21
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label21;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label21 = value;
            }
        }

        internal virtual Label Label22
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label22;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label22 = value;
            }
        }

        internal virtual Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Label Label24
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label24;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label24 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual ToolStripMenuItem mnInPhanTinhLoiNhuan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._mnInPhanTinhLoiNhuan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.mnInPhanTinhLoiNhuan_Click);
                if (this._mnInPhanTinhLoiNhuan != null)
                {
                    this._mnInPhanTinhLoiNhuan.Click -= handler;
                }
                this._mnInPhanTinhLoiNhuan = value;
                if (this._mnInPhanTinhLoiNhuan != null)
                {
                    this._mnInPhanTinhLoiNhuan.Click += handler;
                }
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual C1NumericEdit TxtCongThemNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtCongThemNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtCongThemNT_LostFocus);
                KeyEventHandler handler2 = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtCongThemNT != null)
                {
                    this._TxtCongThemNT.LostFocus -= handler;
                    this._TxtCongThemNT.KeyDown -= handler2;
                }
                this._TxtCongThemNT = value;
                if (this._TxtCongThemNT != null)
                {
                    this._TxtCongThemNT.LostFocus += handler;
                    this._TxtCongThemNT.KeyDown += handler2;
                }
            }
        }

        internal virtual TextBox TxtDiaChiGiaoHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDiaChiGiaoHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDiaChiGiaoHang = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual DateTimePicker TxtHanGiaoHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtHanGiaoHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtHanGiaoHang != null)
                {
                    this._TxtHanGiaoHang.KeyDown -= handler;
                }
                this._TxtHanGiaoHang = value;
                if (this._TxtHanGiaoHang != null)
                {
                    this._TxtHanGiaoHang.KeyDown += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtHoaHong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtHoaHong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtHoaHong = value;
            }
        }

        internal virtual C1NumericEdit TxtMuaHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtMuaHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtMuaHang = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.KeyDown -= handler;
                }
                this._TxtNgayChungTu = value;
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.KeyDown += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtNgayDathang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayDathang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayDathang = value;
            }
        }

        internal virtual DateTimePicker TxtNgayThanhToan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayThanhToan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayThanhToan = value;
            }
        }

        internal virtual TextBox TxtSoBaoGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoBaoGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoBaoGia = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtSoChungTu != null)
                {
                    this._TxtSoChungTu.KeyDown -= handler;
                }
                this._TxtSoChungTu = value;
                if (this._TxtSoChungTu != null)
                {
                    this._TxtSoChungTu.KeyDown += handler;
                }
            }
        }

        internal virtual TextBox TxtSoHopDong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoHopDong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._TxtSoHopDong != null)
                {
                    this._TxtSoHopDong.KeyDown -= handler;
                }
                this._TxtSoHopDong = value;
                if (this._TxtSoHopDong != null)
                {
                    this._TxtSoHopDong.KeyDown += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtSoLuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoLuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoLuong = value;
            }
        }

        internal virtual C1NumericEdit TxtSoTienNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTienNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoTienNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThueNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThueNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienThueNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongCongNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongCongNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongCongNT = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                KeyEventHandler handler = new KeyEventHandler(this.Frm_KeyDown);
                if (this._txtTyGia != null)
                {
                    this._txtTyGia.KeyDown -= handler;
                }
                this._txtTyGia = value;
                if (this._txtTyGia != null)
                {
                    this._txtTyGia.KeyDown += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSlist_BeforeEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSlist_CellButtonClick);
                RowColEventHandler handler3 = new RowColEventHandler(this.VSlist_AfterEdit);
                if (this._VSlist != null)
                {
                    this._VSlist.BeforeEdit -= handler;
                    this._VSlist.CellButtonClick -= handler2;
                    this._VSlist.AfterEdit -= handler3;
                }
                this._VSlist = value;
                if (this._VSlist != null)
                {
                    this._VSlist.BeforeEdit += handler;
                    this._VSlist.CellButtonClick += handler2;
                    this._VSlist.AfterEdit += handler3;
                }
            }
        }
    }
}

